package com.koron.order.repair.bean.convertor;

import com.koron.bean.standard.jobStock.repair.dto.RepairItemDTO;
import com.koron.bean.standard.jobStock.repair.po.RepairItemParams;
import com.koron.order.common.bean.po.OrderDispatch;
import com.koron.order.common.bean.po.OrderExecute;
import com.koron.order.repair.bean.dto.RepairDetailDto;
import com.koron.order.repair.bean.dto.RepairDispatchDto;
import com.koron.order.repair.bean.entity.RepairItemParamsPo;
import com.koron.order.repair.bean.entity.RepairItemPo;
import com.koron.order.repair.bean.entity.RepairPo;
import com.koron.order.repair.bean.vo.RepairDetailVo;
import com.koron.order.repair.bean.vo.RepairDispatchVo;
import com.koron.order.repair.bean.vo.RepairExecuteInfoVo;
import com.koron.order.repair.bean.vo.RepairItemVo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

@Mapper(componentModel = "spring")
public interface RepairConvertor {

    RepairPo voToBean(RepairDetailVo vo);

    RepairPo dtoToBean(RepairDetailDto vo);

    OrderDispatch voToBean(RepairDispatchVo vo);

    OrderDispatch dtoToBean(RepairDispatchDto vo);

    RepairDispatchVo beanToVo(OrderDispatch bean);

    RepairDetailVo beanToRepairDetailVo(RepairPo bean);

    @Mappings({
            @Mapping(target = "id", source = "orderExecuteId")
    })
    OrderExecute voToOrderExecuteVo(RepairExecuteInfoVo vo);

    RepairItemPo voToRepairItemBean(RepairItemVo vo);

    @Mappings({
            @Mapping(target = "standardItemId", source = "id"),
            @Mapping(target = "parentId", source = "parentId")

    })
    RepairItemPo dtoToBean(RepairItemDTO dto);

    @Mappings({
            @Mapping(target = "standardParamId", source = "id")
    })
    RepairItemParamsPo beanToBean(RepairItemParams v);
}
